package com.ooho.lesson05.mvc.service;

import com.ooho.lesson05.mvc.dao.SiteDAO;
import com.ooho.lesson05.mvc.model.SiteBean;

import java.util.List;

/**
 * Created by hugohoo on 10/11/16.
 */
public class SiteService {

    public static List<SiteBean> find(){
        return new SiteDAO().find();
    }

    public static SiteBean find(int id) {
        return new SiteDAO().find(id);
    }

    public static int insert(SiteBean value){
        SiteDAO sd = new SiteDAO();
        int rslt = sd.insert(value);
        sd.close();

        return rslt;
    }

    public static int update(SiteBean value){
        SiteDAO sd = new SiteDAO();
        int rslt = sd.update(value);
        sd.close();

        return rslt;
    }

    public static int delete(SiteBean value){
        SiteDAO sd = new SiteDAO();
        int rslt = sd.delete(value);
        sd.close();

        return rslt;
    }


}
